package com.example.demo.ela;

import java.util.HashMap;
import java.util.List;

import org.apache.lucene.search.Sort;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import com.fasterxml.jackson.databind.util.JSONPObject;

import net.sf.json.JSONObject;

public interface DetailOrderDocumentRepository extends ElasticsearchRepository<OrderDocument, String> {

	
    List<OrderDocument> findByName(String name, Sort sort);
                                                                                             
    DetailOrderDocument findById(String id);
    
    
    public static void main(String[] args) {
		
    	          HashMap map =new HashMap();
    	          map.put("name", "?");
    	          HashMap map2 =new HashMap();
    	          
    	          map2.put("field", map);
    	          HashMap map3 =new HashMap();
    	          map3.put("must", map2);
    	          HashMap map4 =new HashMap();
    	          map4.put("query", map3);
    	          
    	          JSONObject jsonObject = JSONObject.fromObject(map4);
    		        System.out.println("输出的结果是：" + jsonObject);


	}
}